cmake_policy (VERSION 2.8.4)
cmake_policy(SET CMP0012 NEW)

set (CHOWN_TELESCOPE_AUDIO "@BUILD_TELESCOPE_AUDIO@")
set (CHOWN_UHD "@UHD_FOUND@")

if (${CHOWN_TELESCOPE_AUDIO})
execute_process(COMMAND chown @TELESCOPE_USER@:@TELESCOPE_GROUP@ @CMAKE_INSTALL_PREFIX@/bin/telescope_audio)
endif (${CHOWN_TELESCOPE_AUDIO})

if (${CHOWN_UHD})
execute_process(COMMAND chown @TELESCOPE_USER@:@TELESCOPE_GROUP@ @CMAKE_INSTALL_PREFIX@/bin/telescope_dump)
execute_process(COMMAND chown @TELESCOPE_USER@:@TELESCOPE_GROUP@ @CMAKE_INSTALL_PREFIX@/bin/telescope_usrpd)
endif (${CHOWN_UHD})

execute_process(COMMAND chown @TELESCOPE_USER@:@TELESCOPE_GROUP@ @CMAKE_INSTALL_PREFIX@/bin/telescope_samples)
execute_process(COMMAND chown @TELESCOPE_USER@:@TELESCOPE_GROUP@ @CMAKE_INSTALL_PREFIX@/bin/telescope_sqld)

message(STATUS "Permissions updated.")